<?php

namespace app\index\controller;

use app\common\controller\IndexController;
use think\facade\Log;


/**
 * Created by PhpStorm.
 * User: bill-h
 * Date: 2021/11/15
 * Time: 11:05
 * Email: 391878487@qq.com
 */
class Index extends IndexController
{

    public function index(){



        // 渲染默认模板输出
        return $this->fetch();
    }

    //api回调地址
    public function receive_api(){
        !empty(input('param.hooktype'))?$type=input('param.hooktype'):$type='';
        $postdata=file_get_contents("php://input");
        Log::write('请求类型:'.$type.'api回调信息:'.$postdata,'notice');

    }

    //web回调地址
    public function receive_web(){
        $postdata=file_get_contents("php://input");
        Log::write('web回调信息:'.$postdata,'notice');
    }
    //xxljob 测试
    public function xxl_job(){
        $postdata=file_get_contents("php://input");
        if(!empty($postdata)){
            print_r(json_decode($postdata,true));
        }
        Log::write('xxljob:'.$postdata,'notice');
        return "success";
    }
}